<?php

require('fpdf.php');

	$pdf=new FPDF();
    $pdf->SetTextColor(0,0,0);
    $pdf->SetFillColor(48,68,98);
    $pdf->SetDrawColor(0,0,0);
	
    $pdf->AddPage();
    
	//Header
    $pdf->SetFont('Arial','B',24);
    $pdf->Cell(0,10,"KINGS NURSING AND ALLIED HEALTH",0,1,'C');
    $pdf->Cell(0,10,"COLLEGE LTD",0,1,'C');
    $pdf->SetFontSize(14);
    $pdf->Cell(0,20,'',0,1);//blank line
	
    $pdf->Cell(0,10,"P.O. BOX 89, DANSOMAN ACCRA",0,1,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(0,5,"Tel: 233-21-315870      Mobile: 0208185454",0,1,'L');
    $pdf->Cell(0,5,"E-Mail: MLKMC@rogers.com",0,1,'L');
    $pdf->Cell(0,20,'',0,1);//blank line
	
    $pdf->SetFont('Arial','B',14);
    $pdf->Cell(155,10,"APPLICATION FORM",0,2,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(0,10,'',0,1);//blank line
	$pdf->MultiCell(150,5,"i.  Certified photocopy of result slips\nii. Two recent passport-size photographs one of which should be fixed on the form. The remaining photograph should be endorsed.\n(See Declaration section)",0,'L');
	$pdf->SetXY($pdf->GetX()+150,$pdf->GetY()-40); //change coords in order to draw 2 MultiCell's next to each other	
    $pdf->MultiCell(0,5,"\n\n\nFix Passport\nPicture Here\n\n\n\n",1,'C');
    $pdf->Cell(0,20,'',0,1);//blank line
	
	//Personal Information
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(0,10,"1. Name",0,1,'L');
    $pdf->Cell(0,10,"TITLE:",0,1,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(0,10,$_POST["drpTitle"],0,1,'L');
	
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(0,10,"SURNAME:",0,1,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(0,10,$_POST["txtSurname"],0,1,'L');
	
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(0,10,"OTHER NAME:",0,1,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(0,10,$_POST["txtOthername"],0,1,'L');
    $pdf->Cell(0,5,"(Ensure that names correspond with those used for all examinations taken.",0,1,'L');
    $pdf->Cell(0,5,"Provide legal proof for any change in name.)",0,1,'L');
    $pdf->Cell(0,10,'',0,1);//blank line
	
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(0,10,"2. Date of Birth (day, month, year)",0,1,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(0,10,$_POST["txtDOB"],0,1,'L');

    $pdf->AddPage(); //moves to next page to avoid splitting Cells between pages
	
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(0,10,"3. Sex",0,1,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(0,10,$_POST["drpSex"],0,1,'L');
    $pdf->Cell(0,10,'',0,1);//blank line
	
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(0,10,"4. Address to which communication regarding this application should be sent:",0,1,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(0,10,$_POST["txtAddress"],0,1,'L');
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(35,5,"E-Mail Address:   ",0,0,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(0,5,$_POST["txtEmail"],0,1,'L');
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(20,5,"Tel. No:   ",0,0,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(20,5,$_POST["txtPhone"],0,1,'L');
    $pdf->Cell(0,10,'',0,1);//blank line
	
	//Geographics
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(0,10,"5. Geographics",0,1,'L');
    $pdf->Cell(50,5,"i. Place of Birth:   ",0,0,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(0,5,$_POST["txtPlaceofbirth"],0,1,'L');
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(50,5,"ii. Nationality:   ",0,0,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(0,5,$_POST["txtNationality"],0,1,'L');
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(50,5,"iii. Home Town:   ",0,0,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(0,5,$_POST["txtHometown"],0,1,'L');
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(50,5,"iv. Region and Country:   ",0,0,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(0,5,$_POST["txtRegion"],0,1,'L');
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(50,5,"v. Religion:   ",0,0,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(0,5,$_POST["txtReligion"],0,1,'L');
    $pdf->Cell(0,10,'',0,1);//blank line
	
	//Impairments
	//cell(width, height, text, border, next line, align, fill)	
    $pdf->SetFont('Arial','B',12);
	if($_POST["rdoimpairment"]=="Yes")
		$pdf->Cell(0,10,"6. Do you suffer from any form of impairment?  Yes",0,1,'L');		
	else
		$pdf->Cell(0,10,"6. Do you suffer from any form of impairment?  No",0,1,'L');
    $pdf->Cell(0,10,'',0,1);//blank line
	
    $pdf->Cell(0,10,"7. If yes, please specify",0,1,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->MultiCell(0,5,$_POST["txtImpairment"],0,'L');
    $pdf->Cell(0,10,'',0,1);//blank line
	
	//Education
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(0,10,"8. Education",0,1,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(100,10,"Name of Secondary School/College & Location",1,0,'C');
    $pdf->Cell(30,10,"Offices Held",1,0,'C');
    $pdf->MultiCell(0,5,"Attended Dates\n(day, month, year)",1,'C');
	
    $pdf->Cell(100,10,$_POST["txtSecschools1"],1,0,'L');
    $pdf->Cell(30,10,$_POST["txtOffices1"],1,0,'L');
    $pdf->MultiCell(0,5,"From:  ".$_POST["txtSchoolsStartDate1"]."\nTo:  ".$_POST["txtSchoolsEndDate1"],1,'L');
	
    $pdf->Cell(100,10,$_POST["txtSecschools2"],1,0,'L');
    $pdf->Cell(30,10,$_POST["txtOffices2"],1,0,'L');
    $pdf->MultiCell(0,5,"From:  ".$_POST["txtSchoolsStartDate2"]."\nTo:  ".$_POST["txtSchoolsEndDate2"],1,'L');
	
    $pdf->Cell(100,10,$_POST["txtSecschools3"],1,0,'L');
    $pdf->Cell(30,10,$_POST["txtOffices3"],1,0,'L');
    $pdf->MultiCell(0,5,"From:  ".$_POST["txtSchoolsStartDate3"]."\nTo:  ".$_POST["txtSchoolsEndDate3"],1,'L');
    $pdf->Cell(0,10,'',0,1);//blank line
	
    $pdf->AddPage(); //moves to next page to avoid splitting Cells between pages
	
	//Exam
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(0,10,"9. Examination Details",0,1,'L');
    $pdf->Cell(30,10,"Attempts",0,0,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(30,10,"1st",0,0,'C');
    $pdf->Cell(30,10,"2nd",0,0,'C');
    $pdf->Cell(30,10,"3rd",0,1,'C');
	
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(30,5,"Name",0,0,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(30,5,$_POST["txtExamName1"],1,0,'C');
    $pdf->Cell(30,5,$_POST["txtExamName2"],1,0,'C');
    $pdf->Cell(30,5,$_POST["txtExamName3"],1,1,'C');
	
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(30,5,"Year",0,0,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(30,5,$_POST["txtExamYear1"],1,0,'C');
    $pdf->Cell(30,5,$_POST["txtExamYear2"],1,0,'C');
    $pdf->Cell(30,5,$_POST["txtExamYear3"],1,1,'C');
	
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(30,5,"Index No(s)",0,0,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(30,5,$_POST["txtExamIndex1"],1,0,'C');
    $pdf->Cell(30,5,$_POST["txtExamIndex2"],1,0,'C');
    $pdf->Cell(30,5,$_POST["txtExamIndex3"],1,1,'C');
    $pdf->Cell(0,10,'',0,1);//blank line
	
	//Grades
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(0,10,"10. Grades Obtained",0,1,'L');
    $pdf->Cell(80,5,"Subjects",0,0,'C');
    $pdf->Cell(30,5,"",0,0,'C');
    $pdf->Cell(30,5,"Grades",0,0,'C');
    $pdf->Cell(30,5,"",0,1,'C');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(80,5,"",0,0,'C');
    $pdf->Cell(30,5,"1st Attempt",0,0,'C');
    $pdf->Cell(30,5,"2nd Attempt",0,0,'C');
    $pdf->Cell(30,5,"3rd Attempt",0,1,'C');
	
    $pdf->Cell(80,5,$_POST["txtGradesSubject1"],1,0,'L');
    $pdf->Cell(30,5,$_POST["txtGradesFirst1"],1,0,'C');
    $pdf->Cell(30,5,$_POST["txtGradesSecond1"],1,0,'C');
    $pdf->Cell(30,5,$_POST["txtGradesThird1"],1,1,'C');
	
    $pdf->Cell(80,5,$_POST["txtGradesSubject2"],1,0,'L');
    $pdf->Cell(30,5,$_POST["txtGradesFirst2"],1,0,'C');
    $pdf->Cell(30,5,$_POST["txtGradesSecond2"],1,0,'C');
    $pdf->Cell(30,5,$_POST["txtGradesThird2"],1,1,'C');
	
    $pdf->Cell(80,5,$_POST["txtGradesSubject3"],1,0,'L');
    $pdf->Cell(30,5,$_POST["txtGradesFirst3"],1,0,'C');
    $pdf->Cell(30,5,$_POST["txtGradesSecond3"],1,0,'C');
    $pdf->Cell(30,5,$_POST["txtGradesThird3"],1,1,'C');
	
    $pdf->Cell(80,5,$_POST["txtGradesSubject4"],1,0,'L');
    $pdf->Cell(30,5,$_POST["txtGradesFirst4"],1,0,'C');
    $pdf->Cell(30,5,$_POST["txtGradesSecond4"],1,0,'C');
    $pdf->Cell(30,5,$_POST["txtGradesThird4"],1,1,'C');
	
    $pdf->Cell(80,5,$_POST["txtGradesSubject5"],1,0,'L');
    $pdf->Cell(30,5,$_POST["txtGradesFirst5"],1,0,'C');
    $pdf->Cell(30,5,$_POST["txtGradesSecond5"],1,0,'C');
    $pdf->Cell(30,5,$_POST["txtGradesThird5"],1,1,'C');
	
    $pdf->Cell(80,5,$_POST["txtGradesSubject6"],1,0,'L');
    $pdf->Cell(30,5,$_POST["txtGradesFirst6"],1,0,'C');
    $pdf->Cell(30,5,$_POST["txtGradesSecond6"],1,0,'C');
    $pdf->Cell(30,5,$_POST["txtGradesThird6"],1,1,'C');
	
    $pdf->Cell(80,5,$_POST["txtGradesSubject7"],1,0,'L');
    $pdf->Cell(30,5,$_POST["txtGradesFirst7"],1,0,'C');
    $pdf->Cell(30,5,$_POST["txtGradesSecond7"],1,0,'C');
    $pdf->Cell(30,5,$_POST["txtGradesThird7"],1,1,'C');
	
    $pdf->Cell(80,5,$_POST["txtGradesSubject8"],1,0,'L');
    $pdf->Cell(30,5,$_POST["txtGradesFirst8"],1,0,'C');
    $pdf->Cell(30,5,$_POST["txtGradesSecond8"],1,0,'C');
    $pdf->Cell(30,5,$_POST["txtGradesThird8"],1,1,'C');
    $pdf->Cell(0,10,'',0,1);//blank line
	
	//Emergency Contact
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(0,10,"11. Emergency Contact Information",0,1,'L');
    $pdf->Cell(80,5,"Name of Parent or Guardian:   ",0,0,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(0,5,$_POST["txtParentName"],0,1,'L');
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(80,5,"Relationship to Candidate:   ",0,0,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(0,5,$_POST["txtParentRelation"],0,1,'L');
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(80,5,"Address of Parent or Guardian:   ",0,0,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(0,5,$_POST["txtParentAddress"],0,1,'L');
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(10,5,"Tel:   ",0,0,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(40,5,$_POST["txtParentPhone"],0,0,'L');
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(20,5,"E-mail:   ",0,0,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(0,5,$_POST["txtParentEMail"],0,1,'L');
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(80,5,"Occupation of Parent or Guardian:   ",0,0,'L');
    $pdf->SetFont('Arial','',12);
    $pdf->Cell(0,5,$_POST["txtParentOccupation"],0,1,'L');
    $pdf->Cell(0,10,'',0,1);//blank line
		
	//Program of Study
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(0,10,"12. Program You Intend to Study",0,1,'L');
    $pdf->SetFont('Arial','',12);
	if($_POST["program"]=="MLA")
		$pdf->Cell(0,5,"Medical Laboratory Assistant (MLA)",0,1,'L');
	else if($_POST["program"]=="MLT")
		$pdf->Cell(0,5,"Medical Laboratory Technitian (MLT)",0,1,'L');
	else
		$pdf->Cell(0,5,"Medical Laboratory Technologist (DMLT)",0,1,'L');
    $pdf->Cell(0,10,'',0,1);//blank line
	
	//Signature Block
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(50,10,"Signature of Applicant:",0,0,'L');
	$pdf->Line($pdf->GetX(),$pdf->GetY()+8,$pdf->GetX()+60,$pdf->GetY()+8);
    $pdf->Cell(65,10,"",0,0,'L');//blank cell for line
    $pdf->Cell(15,10,"Date:",0,0,'L');
	$pdf->Line($pdf->GetX(),$pdf->GetY()+8,$pdf->GetX()+30,$pdf->GetY()+8);
    $pdf->Cell(35,10,"",0,1,'L');//blank cell for line
	
    $pdf->AddPage(); //moves to next page to avoid splitting Cells between pages

	//Declaration
    $pdf->SetFont('Arial','B',14);
    $pdf->Cell(0,10,"DECLARATION BY WITNESS",0,1,'C');
    $pdf->SetFont('Arial','',12);
    $pdf->MultiCell(0,5,"This declaration should be signed by someone of high repute who should also endorse one of the passport-sized photographs on the reverse side.	This person should be a Senior Public Servant/Clergyman/Lawyer/Medical Practitioner. The applicantion will not be valid if this is not signed.",0,'L');
    $pdf->Cell(0,5,'',0,1);//blank line
    $pdf->Cell(0,5,"I certify that the photograph endorsed by me is the true likeness of the applicant",0,1,'L');
	$pdf->Line($pdf->GetX(),$pdf->GetY()+5,$pdf->GetX()+60,$pdf->GetY()+5);
    $pdf->Cell(65,5,"",0,0);//blank cell for line
    $pdf->Cell(0,5,"who is personally known to me.",0,1,'L');
    $pdf->Cell(0,5,'',0,1);//blank line
	$pdf->MultiCell(0,5,"I have inspected his/her certificates and I am satisfied that the names on them conform to those by which, to the best of my knowledge, he/she is officially known.",0,'L');
    $pdf->Cell(0,10,'',0,1);//blank line
    $pdf->Cell(25,10,"Signature:",0,0,'L');
	$pdf->Line($pdf->GetX(),$pdf->GetY()+8,$pdf->GetX()+60,$pdf->GetY()+8);
    $pdf->Cell(90,10,"",0,0,'L');//blank cell for line
    $pdf->Cell(15,10,"Date:",0,0,'L');
	$pdf->Line($pdf->GetX(),$pdf->GetY()+8,$pdf->GetX()+30,$pdf->GetY()+8);
    $pdf->Cell(35,10,"",0,1,'L');//blank cell for line
	$pdf->Cell(0,10,'',0,1);//blank line
	
    $pdf->Cell(20,5,"Name:   ",0,0,'L');
    $pdf->Cell(0,5,$_POST["txtWitnessName"],0,1,'L');
	
    $pdf->Cell(20,5,"Status:   ",0,0,'L');
    $pdf->Cell(0,5,$_POST["txtWitnessStatus"],0,1,'L');
	
    $pdf->Cell(20,5,"Address:   ",0,0,'L');
    $pdf->Cell(0,5,$_POST["txtWitnessAddress"],0,1,'L');
    $pdf->Cell(0,10,'',0,1);//blank line
	
	//Official Use
    $pdf->SetFont('Arial','B',12);
    $pdf->Cell(160,10,"For Official Use Only",1,1,'C');
    $pdf->SetFont('Arial','',12);
	$pdf->MultiCell(80,10,"Reciept No.________________\nDate:_____________________",1,'L');
	$pdf->SetXY($pdf->GetX()+80,$pdf->GetY()-20); //change coords in order to draw 2 MultiCell's next to each other
	$pdf->MultiCell(80,5,"Qualification vetted by\n\n\n\n",1,'C');
	$pdf->MultiCell(80,5,"\nProgram Offered:",1,'L');
	$pdf->SetXY($pdf->GetX()+80,$pdf->GetY()-10); //change coords in order to draw 2 MultiCell's next to each other
	$pdf->MultiCell(80,5,"\nSignature",1,'L');
	
    //Draw PDF;
    $pdf->Output();
?>